fix(tests): correct test commands and fix oauth-buttons failures#142
fix(tests): correct test commands and fix oauth-buttons failures#142vscarpenter merged 1 commit intomainfrom
Conversation
- Replace `bun test` with `bun run test` across all docs (CLAUDE.md, CONTRIBUTING.md, TECHNICAL.md, GSD_FEATURES_GUIDE.md, OAUTH_OIDC_GUIDE.md, copilot-instructions.md) — `bun test` invokes bun's built-in runner instead of vitest - Add vi.mock for @/lib/env-config in oauth-buttons tests to prevent getEnvironmentConfig() from accessing window.location.hostname - Fix window.location mock in redirect test to include hostname property and restore original location after test - Add setLoading(null) to outer catch block in oauth-buttons.tsx to prevent permanent loading state on unexpected errors (e.g., malformed JSON from server) - Bump version to 6.8.5 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Code Review SummaryOverall Assessment: ✅ LGTM with minor observations This PR addresses a critical documentation/testing issue and fixes real bugs. The changes are well-scoped, properly tested, and improve project quality. Strengths1. Clear Problem Identification
2. Comprehensive Documentation UpdatesUpdated 7 files with consistent messaging:
All updates include the clarifying note: 3. Real Bug FixesBug 1: Missing
Bug 2: Loading state not reset on error } catch (error) {
+ setLoading(null); // ✅ Prevents stuck loading state
console.error("[OAuth] Flow failed:", error);This is a legitimate UI bug fix that prevents buttons from staying in loading state after errors. Bug 3: Incomplete -window.location = { href: '' } as any;
+window.location = { href: '', hostname: 'localhost' } as any;
+
+// ... test code ...
+
+// Restore original location to prevent test contamination
+window.location = originalLocation;
Code Quality✅ Follows CLAUDE.md Guidelines
✅ Test Coverage
✅ Security
✅ Performance
Minor Observations1. Git Workflow Addition to CLAUDE.md+## Git Workflow
+
+For git operations: when asked to commit and push, write a descriptive conventional commit message, bump the version if appropriate, and create a PR unless told otherwise. Standard workflow: commit → push → create PR.Observation: This is a good addition for AI agent guidance, though it's slightly outside the PR's stated scope. Consider whether this should be in 2. Test File Mock OrderingThe 3. Documentation ConsistencyAll documentation files now consistently use RecommendationsBefore Merge
Future Improvements (Not Blocking)
Test Plan VerificationFrom PR description:
Status: Ready to merge once lint check passes. Final VerdictAPPROVED ✅ This PR:
Impact: High value for developer experience and test reliability. Risk: Very low - documentation changes + targeted bug fixes with tests. Review conducted per |



Summary
bun test→bun run testacross all documentation —bun testinvokes bun's built-in test runner (491 failures), whilebun run testdelegates to vitest via package.json (0 failures)tests/ui/oauth-buttons.test.tsxby mocking@/lib/env-configand fixingwindow.locationmockcomponents/sync/oauth-buttons.tsxwhere the outer catch block didn't reset loading stateTest plan
bun run test— 89 test files, 1713 tests passed, 0 failuresbun typecheck— clean, no errorsbun lintpasses in CI🤖 Generated with Claude Code